swgemulatorfandomcom-20200214-history
Crafting macros
A good set of crafting macros can make creating a set of identical items much less tedious. This is wonderful for grinding XP or for making lots of a component that requires no experimentation. What follows is the commonly reproduced macro and a variation on it. Another variation on the same basic macro can be found in the general artical on macros. Basic Grinding Macro the Grind Craft Macro This macro has a section for each crafting tool you will use and assumes you have your crafting tools in slots 1, 2, ... N. You need to have a section beginning "/ui action toolbarSlot0x" for each crafting station (x is the slot number - 1, so 00 for slot 1). Most people recommend at least three tools as a low level artisan and up to eight tools for a high level crafter. You need to create the following macro (called grindCraft in this example). /ui action toolbarSlot00; <-- Selects your crafting tool in the F1 slot /pause 1; <-- Wait for it to load (increase this based on lag) /ui action defaultButton; <-- Automatically press the "Next" button /pause 10; <-- Wait for you to load the resources (increase this based on # of resources) /nextcraftingstage; <-- Finish the item and close the tool /nextcraftingstage; /nextcraftingstage; <-- This third stage is only needed when standing near a crafting station. /createprototype practice noitem; /createprototype practice noitem; /pause 1; <-- Pause just a second before continuing /ui action toolbarSlot01; <-- Select your crafting tool in the F2 slot /pause 1; /ui action defaultButton; ..... <-- Use as many iterations as you have tools The last line of the macro should be /macro grindCraft; this puts the macro in a loop and it will continue until you use the /dump command to end it. using the macro To use the macro, you open your crafting tool and select the schematic for the item you wish to make and exit without making it. You then run the following macro as "/macro grindCraft". It will open the first crafting tool, wait 10 seconds at the Item Assembly Screen for you to load the resources (the "/pause 10"), and then complete the practice crafting session. non-practice version If you want to actually produce the items, replace the lines /createprototype practice noitem; /createprototype practice noitem; with /createprototype; /createprototype; Alias Variation You can use aliases to make this macro a bit easier to manage. Instead of having to adjust pauses in each section of the macro, each pause only appears once. nextTool This alias and it's series of macros automatically selects the next crafting tool to use and cycles through them. You create the initial alias as: /alias nextTool /macro useTool1 You then create a series of macros, one for each tool (in this example 4 tools in slots 1 through 4 of tool bar 3: /macro useTool1 /ui action toolbarPane02; <-- switch to crafting toolbar /ui action toolbarSlot00; <-- open the tool /alias nextTool /macro useTool2; <-- prepare for the next tool in cycle /macro useTool2 /ui action toolbarPane02; /ui action toolbarSlot01; /alias nextTool /macro useTool3; /macro useTool3 /ui action toolbarPane02; /ui action toolbarSlot02; /alias nextTool /macro useTool4; /macro useTool4 /ui action toolbarPane02; /ui action toolbarSlot03; /alias nextTool /macro useTool1; practice This alias replaces the basic macro. It is basicly the same, but uses the nextTool alias to avoid repeating all the lines for each tool. /alias practice /macro doGrindCraft /macro doGrindCraft /nextTool; <-- Selects the next crafting tool in the cycle /pause 1; <-- Wait for it to load (increase this based on lag) /ui action defaultButton; <-- Automatically press the "Next" button /pause 10; <-- Wait for you to load the resources (increase this based on # of resources) /nextcraftingstage; <-- Finish the item and close the tool /nextcraftingstage; /nextcraftingstage; /createprototype practice noitem; /createprototype practice noitem; /pause 1; <-- Pause just a second before continuing /doGrind; Modular Macro Please note that all Crafting Macro's require the use of a Crafting Station or possibly Crafting Droid. The Crafting Macro provided below is for the most part identical to the Macro's provided above. A key notable difference is that mine is more module based, similar to Object Oriented programming. The macro consists of two parts, the Crafting Macro, and a Tool selection Macro. It is the tool selection Macro which separates mine from some others. So let us see the Macro's: (Requires the Creation of a Single product to be made prior to Running) Work Macro Work Macro: (named: GrindCraft_01) /pause 1; /ui action defaultButton; /pause 4; /nextCraftingStage; /nextCraftingStage; /nextCraftingStage; /pause 1; <--possibly not needed but I keep it to allow for lag /createprototype; <--practice noitem; can be added for grinding levels /createprototype; <--practice noitem; can be added for grinding levels Tool Macro Tool Macro (named: Tool_01) /ui action toobarSlot00; <--Tool Selection /macro GrindCraft_01; <--Work Macro called /pause 7; <--delay to allow Work Macro to complete /macro Tool_02; <--call 2nd Tool Macro to operate and use 2nd Tool. Simply increment the Slot## and create additional Tool_## macro's based upon the number of tools used. The last Tool Macro *must* call the first Macro otherwise the loop ends with the last tool. Ex. (named: Tool_04) <--4 tools being used /ui action toolbarSlot03; /macro GrindCraft_01; /pause 7; /macro Tool_01; The main benefit of a modular Macro such as this one is that you can create numerous Work Macro's for the various tasks you need that require a lot of repetition. Then to use the new Work Macro's you simple edit the Work Macro name and the Delay in each Tool Macro. Now you don't need to type 4 separate copies of what can be lengthy code. Well tested grinding macro Since macros in SWGEmu have a limited lines of commands they can save, The Ultimate Crafting Macro will lose the 4 last lines of commands. The workaround is to make two macros that give the same result. This macro setup will need eight tools if you do not modify it. This macro will loop, so when you want it to stop, type /dump or make a macro with the command in it. The /pause 1; lines are put in to deal with lag. If you need more than five seconds to place your materials in the tool, just go in to the macro and change it to a number that suits you. Ex. macro one (macro name: Grind1) /ui action toolbarSlot00; /pause 1; /ui action defaultButton; /pause 5; /nextCraftingStage; /nextCraftingStage; /createPrototype practice noItem; /createPrototype practice noItem; /pause 1; /ui action toolbarSlot01; /pause 1; /ui action defaultButton; /pause 5; /nextCraftingStage; /nextCraftingStage; /createPrototype practice noItem; /createPrototype practice noItem; /pause 1; /ui action toolbarSlot02; /pause 1; /ui action defaultButton; /pause 5; /nextCraftingStage; /nextCraftingStage; /createPrototype practice noItem; /createPrototype practice noItem; /pause 1; /ui action toolbarSlot03; /pause 1; /ui action defaultButton; /pause 5; /nextCraftingStage; /nextCraftingStage; /createPrototype practice noItem; /createPrototype practice noItem; /pause 1; /macro Grind2; Ex. macro two (macro name Grind2) /ui action toolbarSlot04; /pause 1; /ui action defaultButton; /pause 5; /nextCraftingStage; /nextCraftingStage; /createPrototype practice noItem; /createPrototype practice noItem; /pause 1; /ui action toolbarSlot05; /pause 1; /ui action defaultButton; /pause 5; /nextCraftingStage; /nextCraftingStage; /createPrototype practice noItem; /createPrototype practice noItem; /pause 1; /ui action toolbarSlot06; /pause 1; /ui action defaultButton; /pause 5; /nextCraftingStage; /nextCraftingStage; /createPrototype practice noItem; /createPrototype practice noItem; /pause 1; /ui action toolbarSlot07; /pause 1; /ui action defaultButton; /pause 5; /nextCraftingStage; /nextCraftingStage; /createPrototype practice noItem; /createPrototype practice noItem; /pause 1; /macro Grind1;